package planit.model;

import java.awt.Color;
import java.io.Serializable;
import planit.util.ColorTools;


public class EventType implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private static int lastIdUsed;
	private int id;
	private String name;
	private Color color;
	
	public EventType(int id, String name, Color color) {
		this.id = id;
		EventType.lastIdUsed = id;
		setName(name);
		setColor(color);
	}
		
	public EventType(String name){
		this();
		setName(name);
	}
	
	public int getId() {
		return id;
	}
	
	public EventType (){
		color = ColorTools.getRandomColor();
		id = ++lastIdUsed;
		// Default properties
	}
	
	public void setName(String name){
		this.name = name;
	}
	
	public String getName(){
		return name;
	}
	public void setColor(Color color){
		this.color = color;
	}
	
	public Color getColor(){
		return color;
	}

}
